import org.acegisecurity.taglibs.velocity.Authz;
import org.acegisecurity.taglibs.velocity.AuthzImpl;
import package.api.AuthzAware;
import com.opensymphony.xwork.ActionInvocation;
import com.opensymphony.xwork.interceptor.Interceptor;
public class AuthzInterceptor implements Interceptor {
public void destroy()
{}
public void init()
{}
public String intercept(ActionInvocation invocation)
throws Exception
{
if (invocation.getAction() instanceof AuthzAware) {
Authz authz = new AuthzImpl();
AuthzAware authzAware = (AuthzAware)invocation.getAction();
authzAware.setAuthz(authz);
}
return invocation.invoke();
}
}